# EasyHookLib Config File
@PACKAGE_INIT@

# 设置变量
set(EASYHOOKLIB_VERSION "@PROJECT_VERSION@")
set(EASYHOOKLIB_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include")
set(EASYHOOKLIB_LIBRARY_DIR "@CMAKE_INSTALL_PREFIX@/lib")

# 检查必需的组件
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
    set(MINHOOK_LIB_NAME "MinHook.x64.lib")
else()
    set(MINHOOK_LIB_NAME "MinHook.x86.lib")
endif()

# 创建导入目标
if(NOT TARGET EasyHookLib::EasyHookLib)
    add_library(EasyHookLib::EasyHookLib STATIC IMPORTED)
    
    set_target_properties(EasyHookLib::EasyHookLib PROPERTIES
        IMPORTED_LOCATION "${EASYHOOKLIB_LIBRARY_DIR}/EasyHookLib.lib"
        INTERFACE_INCLUDE_DIRECTORIES "${EASYHOOKLIB_INCLUDE_DIR}"
        INTERFACE_LINK_LIBRARIES "${EASYHOOKLIB_LIBRARY_DIR}/${MINHOOK_LIB_NAME}"
    )
endif()

# 设置变量供调用者使用
set(EASYHOOKLIB_LIBRARIES EasyHookLib::EasyHookLib)
set(EASYHOOKLIB_INCLUDE_DIRS ${EASYHOOKLIB_INCLUDE_DIR})